package algo.math.evaluator.context.functions;

import java.lang.reflect.Type;
import algo.math.evaluator.context.IComponentObject;
import algo.math.evaluator.context.functions.interfaces.*;
import algo.math.evaluator.value.IValue;

/**
 * Represent a function.
 */
public class Function implements IFunction,IComponentObject{

	protected String _name;
	
	/** Number of arguments */
	protected int _argsNb;

	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.functions.interfaces.IFunction#getName()
	 */
	@Override
	public String getName() {
		return _name;
	}
	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.functions.interfaces.IFunction#resolve(algo.math.evaluator.value.IValue[])
	 */
	@Override
	public IValue resolve(IValue[] args) {
		return null;
	}
	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.functions.interfaces.IFunction#getArgsNumber()
	 */
	@Override
	public int getArgsNumber() {
		return _argsNb;
	}
	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.IComponentObject#getComponentType()
	 */
	@Override
	public Type getComponentType() {
		return IFunction.class;
	}
	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.IComponentObject#getComponentId()
	 */
	@Override
	public String getComponentId() {
		return _name;
	}
	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.IComponentObject#getComponentName()
	 */
	@Override
	public String getComponentName() {
		return _name;
	}
		
	
}
